/**
 * 
 */
package ru.olympus.antonyhands.ao.server.item.util;

import ru.olympus.antonyhands.ao.server.item.Item;
import ru.olympus.antonyhands.ao.server.item.ItemCategory;

import com.google.common.base.Predicate;

/**
 * @author AntonyHands
 * @since 14.02.2012
 */
public class ItemByCategoryFilter implements Predicate<Item>
{

    private ItemCategory _category;

    public ItemByCategoryFilter(ItemCategory category)
    {
        _category = category;
    }

    @Override
    public boolean apply(Item item)
    {
        if (item == null)
            return false;
        return item.getItemCategory().equals(_category);
    }

}
